package com.project.thisDatabase.elasticsearch.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.stereotype.Component;

@Component
public class ElasticCondition implements Condition {

    @Value(value = "${spring.data.elasticsearch:false}")
    private Boolean shutdownTimeOut;

    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        return shutdownTimeOut;
    }
}
